﻿<%@ Page Language="C#" MasterPageFile="~/web.master" AutoEventWireup="true" CodeBehind="apk_list.aspx.cs" Inherits="Shuba.Web.mobile.apk_list" %>

<%@ Register Assembly="Shuba.Framework" Namespace="Shuba.Framework" TagPrefix="cc" %>
<asp:Content ID="Header1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">   
<script type="text/javascript">
        function PrintThis() {
            var txt = document.getElementById('<%= txtSearch.ClientID %>').value;
            window.open("branch_device_list_excel.aspx?txtSearch=" + txt);
        }
        function CheckAll() {            
            var checkVal;
            if (document.all("ButSelect").value == "Check All") {
                checkVal = true;
                document.all("ButSelect").value = "Un-Check All";
            } else {
                checkVal = false;
                document.all("ButSelect").value = "Check All";
            }

            for (var n = 0; n < document.forms[0].length; n++) {
                elm = document.forms[0].elements[n];
                if (elm.type == 'checkbox') {
                    elm.checked = checkVal;
                }
            }
        }        
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="text bg_content" bgcolor="#FFFFFF" align="center">
                <p>
                    &nbsp;
                </p>
                <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="title_back" align="left">
                            <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="title_back2" width="2%">&nbsp;</td>
                                    <td class="title_back2 title_white" width="38%">
                                        <asp:Label ID="LabelTitle" runat="server" Text="Label"></asp:Label></td>
                                    <td><span class="title_right"></span></td>
                                </tr>
                            </table>
                        </td>
                        <td class="title_back" align="right">                            
                            <asp:LinkButton ID="btnUpload" runat="server" PostBackUrl="upload_apk.aspx" CssClass="black">Upload APK</asp:LinkButton>&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="border_left bg_subtitle_white">&nbsp;&nbsp;&nbsp;List</td>
                        <td class="border_right bg_subtitle" align="right">Version&nbsp;<asp:TextBox ID="txtSearch" CssClass="text" runat="server"></asp:TextBox>&nbsp;
                            <asp:Button ID="btnSearch" CssClass="buttonsmall" runat="server" Text="Search" OnClick="btnSearch_Click" />&nbsp;&nbsp;
                            <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export to Excel" OnClick="btnExport_Click" />&nbsp;&nbsp;                            
                        </td>
                    </tr>
                    <tr>
                        <td class="border" colspan="2">
                            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                <ContentTemplate>
                                    <cc:SHUBAGrid ID="gvList" runat="server" AutoGenerateColumns="False" Width="100%"
                                        DataKeyNames="Version"
                                        AllowPaging="True" PageSize="20" OnPageIndexChanging="gvList_PageIndexChanging"
                                        OnRowDataBound="gvList_RowDataBound" OnRowCommand="gvList_RowCommand"
                                        AllowSorting="True" OnSorting="gvList_Sorting">
                                        <Columns>
                                            <asp:BoundField DataField="DateFileUpload" HeaderText="DATE FILE UPLOAD" SortExpression="DateFileUpload" DataFormatString="{0:dd MMM yyyy hh:mm:ss}" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="DateFileModified" HeaderText="DATE FILE MODIFIED" SortExpression="DateFileModified" DataFormatString="{0:dd MMM yyyy hh:mm:ss}" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="FileSizeUpload" HeaderText="FILE SIZE" SortExpression="FileSizeUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="PathFileUpload" HeaderText="PATH FILE" SortExpression="PathFileUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="NameFolderUpload" HeaderText="DIRECTORY NAME" SortExpression="NameFolderUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="FileNameUpload" HeaderText="FILE NAME" SortExpression="FileNameUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="Version" HeaderText="VERSION" SortExpression="Version" ItemStyle-HorizontalAlign=Center />                                                                                   
                                            <asp:BoundField DataField="Checksum" HeaderText="CHECKSUM" SortExpression="Checksum" ItemStyle-HorizontalAlign=Center />                                                                                   
                                            <asp:TemplateField HeaderStyle-Width="13%">
                                                <ItemTemplate>
                                                    [&nbsp;&nbsp;<asp:LinkButton ID="btnEdit" CssClass="line" runat="server" CommandName="Edit" CommandArgument='<%# Eval("Version") %>'>EDIT</asp:LinkButton>&nbsp;&nbsp;]
                                            [&nbsp;&nbsp;<asp:LinkButton ID="btnDelete" CssClass="line" OnClientClick="return confirm('Are you sure, you want to delete this record')" runat="server" CommandName="Remove" CommandArgument='<%# Eval("Version") %>'>DELETE</asp:LinkButton>&nbsp;&nbsp;]
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <PagerSettings Mode="Numeric" Visible="true" />
                                        <EmptyDataTemplate>
                                            <table class="text" width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td class="bg_grid2" align="center">NO RECORD FOUND</td>
                                                </tr>
                                            </table>
                                        </EmptyDataTemplate>
                                    </cc:SHUBAGrid>
                                </ContentTemplate>
                                <Triggers>                                    
                                    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
                <br />
                <!-- Error Message -->
                <table runat="server" visible="false" id="ErrBox" border="0" width="100%" cellspacing="0" cellpadding="2">
                    <tr>
                        <td class="bg_grid2" align="center">
                            <asp:Label ID="ErrMsg" runat="server" Text="" Font-Bold="true" ForeColor="Red"></asp:Label></td>
                    </tr>
                </table>
                <!-- End Of Error Message -->      
                
                <!-- APPROVAL START HERE -->
                <br />
                <br />
                <asp:Panel ID="ApprovalPnl" Visible="false" runat="server">
                    <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="title_back" align="left" width="40%">
                                <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="title_back2" width="2%">&nbsp;</td>
                                        <td class="title_back2 title_white" width="38%">Need for Approval</td>
                                        <td><span class="title_right" width="60%"></span></td>
                                    </tr>
                                </table>
                            </td>
                            <td class="title_back" align="right">&nbsp;&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="border" colspan="2">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <cc:SHUBAGrid ID="ApprovalGrid" runat="server" AutoGenerateColumns="False" Width="100%"
                                            DataKeyNames="Version"
                                            AllowPaging="True" PageSize="20"
                                            OnPageIndexChanging="ApprovalGrid_PageIndexChanging"
                                            AllowSorting="True" OnSorting="ApprovalGrid_Sorting">
                                            <Columns>
                                                <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" HeaderStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                                                    <HeaderTemplate>
                                                        <input type="button" id="ButSelect" name="ButSelect" value="Check All" class="button" onclick="CheckAll()">
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkItemSelect" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="DateFileUpload" HeaderText="DATE FILE UPLOAD" SortExpression="DateFileUpload" DataFormatString="{0:dd MMM yyyy hh:mm:ss}" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="DateFileModified" HeaderText="DATE FILE MODIFIED" SortExpression="DateFileModified" DataFormatString="{0:dd MMM yyyy hh:mm:ss}" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="FileSizeUpload" HeaderText="FILE SIZE" SortExpression="FileSizeUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="PathFileUpload" HeaderText="PATH FILE" SortExpression="PathFileUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="NameFolderUpload" HeaderText="DIRECTORY NAME" SortExpression="NameFolderUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="FileNameUpload" HeaderText="FILE NAME" SortExpression="FileNameUpload" ItemStyle-HorizontalAlign=Center />
                                            <asp:BoundField DataField="Version" HeaderText="VERSION" SortExpression="Version" ItemStyle-HorizontalAlign=Center />                                                                                   
                                            <asp:BoundField DataField="Checksum" HeaderText="CHECKSUM" SortExpression="Checksum" ItemStyle-HorizontalAlign=Center />                                                                                   
                                                <asp:BoundField DataField="ActType" HeaderText="TYPE" SortExpression="ActType" ItemStyle-HorizontalAlign="Center" />
                                                <asp:BoundField DataField="UpdateBy" HeaderText="MAKER" SortExpression="UpdateBy" ItemStyle-HorizontalAlign="Center" />
                                                <asp:BoundField DataField="UpdateDate" HeaderText="DATE" SortExpression="UpdateDate" DataFormatString="{0:dd MMM yyyy hh:mm:ss tt}" ItemStyle-HorizontalAlign="Center" />
                                            </Columns>
                                            <PagerSettings Mode="Numeric" Visible="true" />
                                        </cc:SHUBAGrid>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="left" class="bg_footer" height="30">&nbsp;
                    <asp:Button ID="btnApprove" Text="Approve" runat="server" CssClass="button" OnClick="btnApprove_Click" OnClientClick="return ApproveValidate();" />
                                <asp:Button ID="btnReject" Text="Reject" runat="server" CssClass="button" OnClick="btnReject_Click" OnClientClick="return RejectValidate();" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <!-- END OF APPROVALE -->         
            </td>
        </tr>
    </table>
</asp:Content>


